package com.example.gameforum.service;

import com.example.gameforum.dao.CommentDao;
import com.example.gameforum.entity.Comment;
import com.example.gameforum.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {

    @Autowired
    private CommentDao commentDao;


    public void insertComment(Comment comment){
        commentDao.save(comment);
    }

    public List<Comment> getAllCommentsByUser(User user){
        return commentDao.findDistinctByCuser(user);
    }

}
